package com.leet.code.lcof2;

public class Code001 {

    public int divide(int a, int b) {

        if (a == 0) {
            return 0;
        }

        int mid = 16;

        int ra = a, rb = b;
        boolean is1 = ((ra >>> 31) ^ (rb >>> 31)) == 1;

        if (ra < 0) {
            ra = -ra;
        }
        if (rb < 0) {
            rb = -rb;
        }

        int result = 0;
        while (ra < rb) {
            result++;
            ra >>= 1;
        }




        return result;
    }

    public static void main(String[] args) {
        int ra = -1;
        int rb = -2;
        boolean is1 = ((ra >>> 31) ^ (rb >>> 31)) == 1;
        System.out.println(is1);
    }


}
